spatialCooccur is an R package for analyzing spatial
co-occurrence and neighborhood interactions in spatial transcriptomics
data. It is built around Seurat objects and provides tools to compute
co-occurrence enrichment, perform permutation-based tests, and visualize
local interaction scores.
You can install the development version from GitHub using:
# install.packages("devtools")
devtools::install_github("juninamo/spatialCooccur")
see details here
generate_sim()nhood_enrichment()cooccur_local()To simulate spatial transcriptomic data and perform neighborhood enrichment analysis:
df = generate_sim(close_ratio = 1, n_types = 15, max_loc = 800, n_cells = 500, test_type = "circle", distance_param = 20, seed=1234)
# Run neighborhood enrichment analysis
nhood_enrichment_res <- nhood_enrichment(df, cluster_key = "cell_type", neighbors.k = 30, n_perms = 100, seed = 1234, n_jobs = 4)
nhood_enrichment_res$zscore
To compute co-localization scores for cell interactions:
cooccur_local_df <- cooccur_local(df, cluster_x = "cell_type_1", cluster_y = "cell_type_2", neighbors.k = 30, radius = 30)
summary(cooccur_local_df)
For questions or issues related to this tutorial, please contact;
Name: Jun Inamo
Email: jun.inamo@cuanschutz.edu
Affiliation: Computational Omics and Systems Immunology
(COSI) Lab, Division of Rheumatology and Center for Health AI,
University of Colorado School of Medicine, CO, USA
The data presented here comes from the Yomogida lab through collaborating with XXX and YYY.
This research was supported by Japan Society for the Promotion of Science (JSPS) Grant-in-Aids for JSPS XXX.
This repository is provided under the MIT License.